//
//  receiveConfig.m
//  tcpoctest
//
//  Created by gump on 5/16/13.
//  Copyright (c) 2013 gump. All rights reserved.
//

#import "receiveConfig.h"

#import "PromptLoginDataSource.h"

#import "sendLogin.h"

@implementation receiveConfig

-(void)processreceive
{
    [logicsb ReadChar];
    
    unsigned char index = [logicsb ReadChar];
    switch (index)
    {
        case CM_SUCCESS:
        {
            [[DataControl shareControl] SetLoginType:LT_MAIL];
            
            [[DataControl shareControl].promptloginDS SetIsPromptLogin:true];
            [[DataControl shareControl].promptloginDS SetIsShowMain:true];
            [[DataControl shareControl].promptloginDS SetIsInitData:true];
            
            [[netManager sharedNetManager].sendlonginbymail sendLoginByMail:
             [DataControl shareControl].personDS.uinfo.mail
                                                                     withPS:
             [DataControl shareControl].personDS.uinfo.ps];
        }
            break;
        case CM_FAIL:
        case CM_DIVCEFULL:
        {
            [[DataControl shareControl] SetConfigFailID:index];
            
            [[DataControl shareControl].UICommendDS addUICommand:UC_CONFIGFAIL];
        }
            break;
        default:
            break;
    }
    
    [self ShowLog];

}

@end
